package androidx.fragment.app;

import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;
import java.util.ArrayList;
import o.jt;
import o.FragmentTransaction.b;
import o.kd;
import o.kp.c;

@SuppressLint({"BanParcelableUsage"})
public final class BackStackState implements Parcelable {
    public static final Creator<BackStackState> CREATOR = new Creator<BackStackState>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return ˎ(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return ˋ(i);
        }

        public BackStackState ˎ(Parcel parcel) {
            return new BackStackState(parcel);
        }

        public BackStackState[] ˋ(int i) {
            return new BackStackState[i];
        }
    };
    final int ʻ;
    final CharSequence ʼ;
    final int ʽ;
    final ArrayList<String> ˊ;
    final CharSequence ˊॱ;
    final int ˋ;
    final int ˋॱ;
    final int[] ˎ;
    final int[] ˏ;
    final ArrayList<String> ˏॱ;
    final ArrayList<String> ͺ;
    final int[] ॱ;
    final boolean ॱˊ;
    final String ॱॱ;
    final int ᐝ;

    public BackStackState(jt jtVar) {
        int size = jtVar.ˋ.size();
        this.ˎ = new int[(size * 5)];
        if (jtVar.ˋॱ) {
            this.ˊ = new ArrayList(size);
            this.ॱ = new int[size];
            this.ˏ = new int[size];
            int i = 0;
            for (int i2 = 0; i2 < size; i2++) {
                b bVar = (b) jtVar.ˋ.get(i2);
                int i3 = i + 1;
                this.ˎ[i] = bVar.ˊ;
                this.ˊ.add(bVar.ॱ != null ? bVar.ॱ.ˊॱ : null);
                int i4 = i3 + 1;
                this.ˎ[i3] = bVar.ˋ;
                i3 = i4 + 1;
                this.ˎ[i4] = bVar.ˎ;
                i4 = i3 + 1;
                this.ˎ[i3] = bVar.ˏ;
                i = i4 + 1;
                this.ˎ[i4] = bVar.ॱॱ;
                this.ॱ[i2] = bVar.ʽ.ordinal();
                this.ˏ[i2] = bVar.ʻ.ordinal();
            }
            this.ˋ = jtVar.ʻ;
            this.ʻ = jtVar.ʽ;
            this.ॱॱ = jtVar.ॱˊ;
            this.ᐝ = jtVar.ॱ;
            this.ʽ = jtVar.ˏॱ;
            this.ʼ = jtVar.ͺ;
            this.ˋॱ = jtVar.ʻॱ;
            this.ˊॱ = jtVar.ॱˎ;
            this.ˏॱ = jtVar.ॱˋ;
            this.ͺ = jtVar.ᐝॱ;
            this.ॱˊ = jtVar.ॱᐝ;
            return;
        }
        throw new IllegalStateException("Not on back stack");
    }

    public BackStackState(Parcel parcel) {
        this.ˎ = parcel.createIntArray();
        this.ˊ = parcel.createStringArrayList();
        this.ॱ = parcel.createIntArray();
        this.ˏ = parcel.createIntArray();
        this.ˋ = parcel.readInt();
        this.ʻ = parcel.readInt();
        this.ॱॱ = parcel.readString();
        this.ᐝ = parcel.readInt();
        this.ʽ = parcel.readInt();
        this.ʼ = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.ˋॱ = parcel.readInt();
        this.ˊॱ = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.ˏॱ = parcel.createStringArrayList();
        this.ͺ = parcel.createStringArrayList();
        this.ॱˊ = parcel.readInt() != 0;
    }

    public jt ˎ(kd kdVar) {
        int i = 0;
        jt jtVar = new jt(kdVar);
        int i2 = 0;
        while (i < this.ˎ.length) {
            b bVar = new b();
            int i3 = i + 1;
            bVar.ˊ = this.ˎ[i];
            if (kd.ˎ) {
                Log.v("FragmentManager", "Instantiate " + jtVar + " op #" + i2 + " base fragment #" + this.ˎ[i3]);
            }
            String str = (String) this.ˊ.get(i2);
            if (str != null) {
                bVar.ॱ = (Fragment) kdVar.ॱॱ.get(str);
            } else {
                bVar.ॱ = null;
            }
            bVar.ʽ = c.values()[this.ॱ[i2]];
            bVar.ʻ = c.values()[this.ˏ[i2]];
            int i4 = i3 + 1;
            bVar.ˋ = this.ˎ[i3];
            i3 = i4 + 1;
            bVar.ˎ = this.ˎ[i4];
            int i5 = i3 + 1;
            bVar.ˏ = this.ˎ[i3];
            i4 = i5 + 1;
            bVar.ॱॱ = this.ˎ[i5];
            jtVar.ˎ = bVar.ˋ;
            jtVar.ᐝ = bVar.ˎ;
            jtVar.ॱॱ = bVar.ˏ;
            jtVar.ʼ = bVar.ॱॱ;
            jtVar.ॱ(bVar);
            i2++;
            i = i4;
        }
        jtVar.ʻ = this.ˋ;
        jtVar.ʽ = this.ʻ;
        jtVar.ॱˊ = this.ॱॱ;
        jtVar.ॱ = this.ᐝ;
        jtVar.ˋॱ = true;
        jtVar.ˏॱ = this.ʽ;
        jtVar.ͺ = this.ʼ;
        jtVar.ʻॱ = this.ˋॱ;
        jtVar.ॱˎ = this.ˊॱ;
        jtVar.ॱˋ = this.ˏॱ;
        jtVar.ᐝॱ = this.ͺ;
        jtVar.ॱᐝ = this.ॱˊ;
        jtVar.ˏ(1);
        return jtVar;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        int i2 = 0;
        parcel.writeIntArray(this.ˎ);
        parcel.writeStringList(this.ˊ);
        parcel.writeIntArray(this.ॱ);
        parcel.writeIntArray(this.ˏ);
        parcel.writeInt(this.ˋ);
        parcel.writeInt(this.ʻ);
        parcel.writeString(this.ॱॱ);
        parcel.writeInt(this.ᐝ);
        parcel.writeInt(this.ʽ);
        TextUtils.writeToParcel(this.ʼ, parcel, 0);
        parcel.writeInt(this.ˋॱ);
        TextUtils.writeToParcel(this.ˊॱ, parcel, 0);
        parcel.writeStringList(this.ˏॱ);
        parcel.writeStringList(this.ͺ);
        if (this.ॱˊ) {
            i2 = 1;
        }
        parcel.writeInt(i2);
    }
}
